import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { resolvePkgPath } from '../rollup/utils';
import replace from '@rollup/plugin-replace';

// https://vitejs.dev/config/
export default defineConfig({
	plugins: [react(), replace({ __DEV__: true, preventAssignment: true })],
	resolve: {
		alias: [
			{ find: 'react', replacement: resolvePkgPath('react') },
			{ find: 'react-dom', replacement: resolvePkgPath('react-dom') },
			{
				find: 'hostConfig',
				replacement: `${resolvePkgPath('react-dom')}/src/hostConfig.ts`
			}
		]
	}
});
